<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>前端直传COS DEMO</title>
</head>
<body>
<input id="upload-file" type="file">
</body>
<script src="/js/jquery-3.2.1.min.js"></script>
<script src="/js/vendor/common.js"></script>
<script src="/js/cos-js-sdk-v5.js"></script>
<script src="/js/vendor/upload-cos.js"></script>

<script>
    $(function () {
        CosUpload.cosInit("/file/getCosInfo");
    });

    $("#upload-file").change(function () {
        CosUpload.progressCallback = function (progress) {
            console.log(progress);
        };
        var file = this.files[0];
        if (!file) return;
        console.log(CosUpload.sliceUpload(file, file.name, "liftZone"));
    });


</script>
</html>